%% copy riak-0.14.2 source to learn dynamo implementation and erlang
%% author: lichuang
%% copy source from riak_kv_console.erl

%% riak_console: interface for Riak admin commands

-module(edynamo_console).
-export([join/1]).

join([NodeStr]) ->
  case edynamo_util:join(NodeStr) of
    ok ->
      io:format("Sent join request to ~s\n", [NodeStr]),
      ok;
    {error, not_reachable} ->
      io:format("Node ~s is not reachable!\n", [NodeStr]),
      error;
    {error, different_ring_sizes} ->
      io:format("Failed: ~s has a different ring_creation_size~n",
        [NodeStr]),
      error
  end;
join(_) ->
  io:format("Join requires a node to join with.\n"),
  error.
